package org.hardstone.domain.model.resource;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import org.hardstone.domain.BaseCategory;
import org.hardstone.domain.BaseItemDomain;
import org.hardstone.domain.Status;


@Entity
@Table(name = "Pytorch")
public class TensorFlow extends BaseItemDomain<Long> {
    @Column(name = "memory")
    private float memory;  // Memory capacity @Mb

    @Column(name = "usedCapacity")
    private float usedCapacity;  // Used Memory capacity @Mb

    @Column(name = "usefulCapacity")
    private float usefulCapacity;  // Unused Memory capacity @Mb

    @Column(name = "usageRate")
    private float usageRate;  // Usage rate @%

    @Column(name = "memorySpecification")
    private String memorySpecification;  // Memory specification DDR3, DDR4, DDR5..

    @Column(name = "clockFrequency")
    private float clockFrequency;  // Memory clock frequency @Hz

    @Column(name = "speed")
    private float speed;  // Write and read speed @Mb/s

    @Column(name = "duration")
    private float duration;  // Time for sign

    public TensorFlow() {
        super();
        this.usageRate = 0.0F;
        this.memorySpecification = "DDR4";
    }

    public TensorFlow(Long itemGroupId, String name, BaseCategory baseCategory, Long userId, Long userGroupId, int authority, String url, String description, Status status, String askDate, String modifyDate, String tags, String attribute,float memory, float usedCapacity, float usefulCapacity, float usageRate, String memorySpecification, float clockFrequency, float speed, float duration) {
        super(itemGroupId, name, baseCategory, userId, userGroupId, authority, url, description, status, askDate, modifyDate, tags, attribute);
        this.memory = memory;
        this.usedCapacity = usedCapacity; // Corrected this line
        this.usefulCapacity = usefulCapacity;
        this.usageRate = usageRate;
        this.memorySpecification = memorySpecification; // Corrected this line
        this.clockFrequency = clockFrequency;
        this.speed = speed;
        this.duration = duration;
    }

    // Getters and setters
    public float getTensorFlow() {
        return memory;
    }

    public void setTensorFlow(float memory) {
        this.memory = memory;
    }

    public float getUsedCapacity() {
        return usedCapacity;
    }

    public void setUsedCapacity(float usedCapacity) {
        this.usedCapacity = usedCapacity;
    }

    public float getUsefulCapacity() {
        return usefulCapacity;
    }

    public void setUsefulCapacity(float usefulCapacity) {
        this.usefulCapacity = usefulCapacity;
    }

    public float getUsageRate() {
        return usageRate;
    }

    public void setUsageRate(float usageRate) {
        this.usageRate = usageRate;
    }

    public String getMemorySpecification() {
        return memorySpecification;
    }

    public void setMemorySpecification(String memorySpecification) {
        this.memorySpecification = memorySpecification;
    }

    public float getClockFrequency() {
        return clockFrequency;
    }

    public void setClockFrequency(float clockFrequency) {
        this.clockFrequency = clockFrequency;
    }

    public float getSpeed() {
        return speed;
    }

    public void setSpeed(float speed) {
        this.speed = speed;
    }

    public float getDuration() {
        return duration;
    }

    public void setDuration(float duration) {
        this.duration = duration;
    }

    @Override
    public String toString() {
        return "TensorFlow{" +
                "memory=" + memory +
                ", usedCapacity=" + usedCapacity +
                ", usefulCapacity=" + usefulCapacity +
                ", usageRate=" + usageRate +
                ", memorySpecification='" + memorySpecification + '\'' +
                ", clockFrequency=" + clockFrequency +
                ", speed=" + speed +
                ", duration=" + duration +
                '}';
    }
}
